package libcommonuse11.runtimedemo;
public class RuntimeDemo01
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		
		Runtime run = Runtime.getRuntime();
		System.out.println("jvm的最大内存量："+run.maxMemory());
		System.out.println("jvm的空闲内存量："+run.freeMemory());
		String str ="hello"+"World"+"!!!"+
		"\t"+"Welcome "+"To"+"MLDN"+"~";
		System.out.println(str);
		for(int x=0;x<100;x++)
		{
			str += x;
		}
		System.out.println(run.freeMemory());
		run.gc();
		System.out.println(run.freeMemory());
		try
		{
			Process pro =  run.exec("notepad.exe");
			Thread.sleep(2000);
			pro.destroy();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		
	}

}
